/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version: 1.3.8 * */ !function(e){e.fn.extend({slimScroll:function(i){var s=e.extend({width:"auto",height:"250px",size:"6px",color:"#a6a6a6",position:"right",distance:"0",start:"top",opacity:1,alwaysVisible:!0,disableFadeOut:!1,railVisible:!0,railColor:"#dfdfdf",railOpacity:1,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"8px",railBorderRadius:"8px"},i);return this.each(function(){var o,a,r,l,n,c,h,u,d="
",p=30,g=!1,f=e(this);if(f.parent().hasClass(s.wrapperClass)){var b=f.scrollTop();if(H=f.siblings("."+s.barClass),C=f.siblings("."+s.railClass),R(),e.isPlainObject(i)){if("height"in i&&"auto"==i.height){f.parent().css("height","auto"),f.css("height","auto");var v=f.parent().parent().height();f.parent().css("height",v),f.css("height",v)}else if("height"in i){var w=i.height;f.parent().css("height",w),f.css("height",w)}if("scrollTo"in i)b=parseInt(s.scrollTo);else if("scrollBy"in i)b+=parseInt(s.scrollBy);else if("destroy"in i)return H.remove(),C.remove(),void f.unwrap();E(b,!1,!0)}}else if(!(e.isPlainObject(i)&&"destroy"in i)){s.height="auto"==s.height?f.parent().height():s.height;var m=e(d).addClass(s.wrapperClass).css({position:"relative",overflow:"hidden",width:s.width,height:s.height});f.css({overflow:"hidden",width:s.width,height:s.height});var y,C=e(d).addClass(s.railClass).css({width:s.size,height:"100%",position:"absolute",top:0,display:s.alwaysVisible&&s.railVisible?"block":"none","border-radius":s.railBorderRadius,background:s.railColor,opacity:s.railOpacity,zIndex:90}),H=e(d).addClass(s.barClass).css({background:s.color,width:s.size,position:"absolute",top:0,opacity:s.opacity,display:s.alwaysVisible?"block":"none","border-radius":s.borderRadius,BorderRadius:s.borderRadius,MozBorderRadius:s.borderRadius,WebkitBorderRadius:s.borderRadius,zIndex:99}),x="right"==s.position?{right:s.distance}:{left:s.distance};C.css(x),H.css(x),f.wrap(m),f.parent().append(H),f.parent().append(C),s.railDraggable&&H.bind("mousedown",function(i){var s=e(document);return r=!0,t=parseFloat(H.css("top")),pageY=i.pageY,s.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,H.css("top",currTop),E(0,H.position().top,!1)}),s.bind("mouseup.slimscroll",function(e){r=!1,M(),s.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(e){return e.stopPropagation(),e.preventDefault(),!1}),C.hover(function(){D()},function(){M()}),H.hover(function(){a=!0},function(){a=!1}),f.hover(function(){o=!0,D(),M()},function(){o=!1,M()}),f.bind("touchstart",function(e,t){e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageY)}),f.bind("touchmove",function(e){(g||e.originalEvent.preventDefault(),e.originalEvent.touches.length)&&(E((n-e.originalEvent.touches[0].pageY)/s.touchScrollStep,!0),n=e.originalEvent.touches[0].pageY)}),R(),"bottom"===s.start?(H.css({top:f.outerHeight()-H.outerHeight()}),E(0,!0)):"top"!==s.start&&(E(e(s.start).position().top,null,!0),s.alwaysVisible||H.hide()),y=this,window.addEventListener?(y.addEventListener("DOMMouseScroll",S,!1),y.addEventListener("mousewheel",S,!1)):document.attachEvent("onmousewheel",S)}function S(t){if(o){var i=0;(t=t||window.event).wheelDelta&&(i=-t.wheelDelta/120),t.detail&&(i=t.detail/3);var a=t.target||t.srcTarget||t.srcElement;e(a).closest("."+s.wrapperClass).is(f.parent())&&E(i,!0),t.preventDefault&&!g&&t.preventDefault(),g||(t.returnValue=!1)}}function E(e,t,i){g=!1;var o=e,a=f.outerHeight()-H.outerHeight();if(t&&(o=parseInt(H.css("top"))+e*parseInt(s.wheelStep)/100*H.outerHeight(),o=Math.min(Math.max(o,0),a),o=e>0?Math.ceil(o):Math.floor(o),H.css({top:o+"px"})),o=(h=parseInt(H.css("top"))/(f.outerHeight()-H.outerHeight()))*(f[0].scrollHeight-f.outerHeight()),i){var r=(o=e)/f[0].scrollHeight*f.outerHeight();r=Math.min(Math.max(r,0),a),H.css({top:r+"px"})}f.scrollTop(o),f.trigger("slimscrolling",~~o),D(),M()}function R(){c=Math.max(f.outerHeight()/f[0].scrollHeight*f.outerHeight(),p),H.css({height:c+"px"});var e=c==f.outerHeight()?"none":"block";H.css({display:e})}function D(){if(R(),clearTimeout(l),h==~~h){if(g=s.allowPageScroll,u!=h){var e=0==~~h?"top":"bottom";f.trigger("slimscroll",e)}}else g=!1;u=h,c>=f.outerHeight()?g=!0:(H.stop(!0,!0).fadeIn("fast"),s.railVisible&&C.stop(!0,!0).fadeIn("fast"))}function M(){s.alwaysVisible||(l=setTimeout(function(){s.disableFadeOut&&o||a||r||(H.fadeOut("slow"),C.fadeOut("slow"))},1e3))}}),this}}),e.fn.extend({slimscroll:e.fn.slimScroll})}(jQuery); if (jQuery(window).width() > 767) { jQuery(document).ready(function() { jQuery("#slimscroll-1").slimScroll({ height: "150px", }); jQuery("#slimscroll-market").slimScroll({ height: "260px", }); }); jQuery(document).ready(function() { jQuery("#slimscroll-2").slimScroll({ height: "300px", }); }); jQuery(document).ready(function() { jQuery("#slimscroll-4").slimScroll({ height: "480px", }); }); } jQuery(document).ready(function() { jQuery("#slimscroll-3").slimScroll({ height: "220px", }); }); jQuery(document).ready(function() { jQuery(".content-mid-box > div[name='slimscrolling']").slimScroll({ height: "110px", }); }); jQuery(document).ready(function() { setInterval(function(){ if ( jQuery('div[id^="cia-stock-price-"]').length > 0 ) { jQuery.ajax({ type: "POST", url: election_ajax_object.ajaxurl, data: { action: 'budget_stock_price', }, success: function( result ){ var obj = JSON.parse(result); jQuery( 'div[id^="cia-stock-price-"]' ).each(function( index ) { curr_id = jQuery(this).attr('id'); curr_id = curr_id.replace('cia-stock-price-',''); var LatestPrice = obj[curr_id].LatestPrice; var WeekHigh = obj[curr_id].WeekHigh; var WeekLow = obj[curr_id].WeekLow; var MCAP = obj[curr_id].MCAP; MCAP = MCAP.toFixed(2); jQuery('#LatestPrice-'+curr_id).html( LatestPrice ); jQuery('#WeekRange-'+curr_id).html( WeekHigh+ ' - ' + WeekLow ); jQuery('#Mcap-'+curr_id).html( MCAP ); }); } }); } },60000); });